#ifndef TDL_H
#define TDL_H

#include "Function.h"

class TDL
{
    public:
        TDL();
        TDL(QString page);
        void setPage(QString page);
        QString unparsedPage();
        QString parse();
        QString calculateExp(QString exp);
        bool calculateCondition(QString exp);
        QString findType(QString exp);
        bool varExists(QString name);
        QString getVarValue(QString name);
    private:
        QString parseBlock(QString code, bool funcCode = false);
        void SysInit();
        bool isOperator(QChar s);

        QString _unparsedPage;
        QString _parsedPage;

        QMap<QString,QString> vars;

        QList<Function> userFunctions;
        QList<SysFunction> sysFunctions;
};

#endif // TDL_H
